import { createBrowserRouter } from 'react-router-dom'
import App from '../App'
import Home from '../pages/home/index'
import { Index as Guan } from '../pages/guan/index'
import Login from '../pages/login'
import Error from '../pages/404/eroe'
import PermissionTest from '../pages/permission-test'



const router = createBrowserRouter([
    {
        index: true,
        element: <Home></Home>,
    },
    {
        path: '/',
        element: <App />,
        children: [
            {
                path: '/home',
                element: <Home></Home>
            },
            {
                path: '/guan',
                element: <Guan></Guan>
            },
            {
                path: '/permission-test',
                element: <PermissionTest></PermissionTest>
            },
        ]
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path: '/*',
        element: <Error />
    }

])

export default router